package com.jiayang.hhotel.presenter;

import com.jiayang.hhotel.bean.Constant;
import com.jiayang.hhotel.bean.LoginModel;
import com.jiayang.hhotel.fragment.FrontFragment;
import com.jiayang.hhotel.util.IOUtil;

import java.util.ArrayList;
import java.util.List;

import cn.droidlover.xdroidmvp.mvp.XPresent;

/**
 * Created by Administrator on 2017/6/3 0003.
 * 首页fragment的逻辑类
 */

public class FrontFragmentPresenter extends XPresent<FrontFragment> {

    public void getJurisdictionList(){
        List<LoginModel.LoginBean.PRightIdDtolistBean> list=new ArrayList<>();
        LoginModel.LoginBean.PRightIdDtolistBean ss=new LoginModel.LoginBean.PRightIdDtolistBean();
        ss.setEngDescp("");
        ss.setChnDescp("订房查询");
        ss.setCode("020801");
        list.add(ss);
        LoginModel.LoginBean.PRightIdDtolistBean ss1=new LoginModel.LoginBean.PRightIdDtolistBean();
        ss1.setEngDescp("");
        ss1.setChnDescp("订餐查询");
        ss1.setCode("020803");
        list.add(ss1);
        LoginModel.LoginBean.PRightIdDtolistBean ss2=new LoginModel.LoginBean.PRightIdDtolistBean();
        ss2.setEngDescp("");
        ss2.setChnDescp("可租房");
        ss2.setCode("1402");
        list.add(ss2);
        LoginModel.LoginBean.PRightIdDtolistBean ss3=new LoginModel.LoginBean.PRightIdDtolistBean();
        ss3.setEngDescp("");
        ss3.setChnDescp("最新统计");
        ss3.setCode("1401");
        list.add(ss3);
        LoginModel.LoginBean.PRightIdDtolistBean ss4=new LoginModel.LoginBean.PRightIdDtolistBean();
        ss4.setEngDescp("");
        ss4.setChnDescp("现住查询");
        ss4.setCode("0301");
        list.add(ss4);
        LoginModel.LoginBean.PRightIdDtolistBean ss5=new LoginModel.LoginBean.PRightIdDtolistBean();
        ss5.setEngDescp("");
        ss5.setChnDescp("查房");
        ss5.setCode("0401");
        list.add(ss5);
        LoginModel.LoginBean.PRightIdDtolistBean ss6=new LoginModel.LoginBean.PRightIdDtolistBean();
        ss6.setEngDescp("");
        ss6.setChnDescp("清洁");
        ss6.setCode("0402");
        list.add(ss6);
        LoginModel.LoginBean.PRightIdDtolistBean ss7=new LoginModel.LoginBean.PRightIdDtolistBean();
        ss7.setEngDescp("");
        ss7.setChnDescp("特殊房态");
        ss7.setCode("0411");
        list.add(ss7);
        LoginModel.LoginBean.PRightIdDtolistBean ss8=new LoginModel.LoginBean.PRightIdDtolistBean();
        ss8.setEngDescp("");
        ss8.setChnDescp("帐务处理");
        ss8.setCode("06");
        list.add(ss8);
        LoginModel.LoginBean.PRightIdDtolistBean ss9=new LoginModel.LoginBean.PRightIdDtolistBean();
        ss9.setEngDescp("");
        ss9.setChnDescp("夜审");
        ss9.setCode("16");
        list.add(ss9);
        LoginModel.LoginBean.PRightIdDtolistBean ss10=new LoginModel.LoginBean.PRightIdDtolistBean();
        ss10.setEngDescp("");
        ss10.setChnDescp("统计分析");
        ss10.setCode("0105");
        list.add(ss10);
        LoginModel.LoginBean.PRightIdDtolistBean ss11=new LoginModel.LoginBean.PRightIdDtolistBean();
        ss11.setEngDescp("");
        ss11.setChnDescp("协议客户");
        ss11.setCode("0106");
        list.add(ss11);
        LoginModel.LoginBean.PRightIdDtolistBean ss12=new LoginModel.LoginBean.PRightIdDtolistBean();
        ss12.setEngDescp("");
        ss12.setChnDescp("设置");
        ss12.setCode("15");
        list.add(ss12);
        LoginModel.LoginBean bean=new LoginModel.LoginBean();
        bean.setPRightIdDtolist(list);
        LoginModel log=new LoginModel();
        log.setInfo("");
        log.setLogin(bean);
        log.setState(9);
        IOUtil.saveObject(Constant.JURISDICTION_SHARED_KEY,log);
        LoginModel model= (LoginModel) IOUtil.getObject(Constant.JURISDICTION_SHARED_KEY);
        if(model!=null){
            getV().setAdapter(model.getLogin().getPRightIdDtolist());
        }
    }
}
